Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODNameSpaceManager


CreateNameSpace

The CreateNameSpace method creates a new name space.

ODNameSpace CreateNameSpace (
                           in ODISOStr spaceName, 
                           in ODNameSpace inheritsFrom, 
                           in ODULong numExpectedEntries, 
                           in ODNSTypeSpec type);
spaceName
A unique name for the new name space.
inheritsFrom
A reference to the parent name space of the new name space, or kODNULL if this name space has no parent.
numExpectedEntries
The expected number of entries to be stored in the new name space.
type
The type of the new name space. The type must be either object name space (kODNSDataTypeODObject) or value name space (kODNSDataTypeODValue).
return value
A reference to the newly created name space, or kODNULL if a name space already exists with the specified name.
DISCUSSION
You call this method to create either a new object name space or a new value name space, as specified by the type parameter. The spaceName parameter should specify a unique name for the new name space.

If the inheritsFrom parameter is not null, it should specify a parent name space of the same type as the one being created.

Because the current implementation of name spaces uses a hash table, the value you specify in the numExpectedEntries parameter should be a prime number to make the hashing algorithm much more efficient. Choose a prime number close to, and greater than, the expected number of entries. The name space can accommodate more entries than you specify (at the expense of performance), but it cannot grow in size.

SEE ALSO
The ODISOStr type (page 875).
The ODNameSpaceManager::DeleteNameSpace method (page 437).
The ODNameSpaceManager::HasNameSpace method (page 438).
The ODNameSpace class (page 428).
The ODObjectNameSpace class (page 450).
The ODValueNameSpace class (page 820).
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help